package com.redepronik.negosys.invfac.entity;

import java.io.Serializable;
import java.math.BigDecimal;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQuery;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

/**
 * The persistent class for the detalleingreso database table.
 * 
 */
@Entity
@Table(schema = "invfac", name = "detalleingreso")
@NamedQuery(name = "Detalleingreso.findAll", query = "SELECT d FROM Detalleingreso d")
public class Detalleingreso implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@SequenceGenerator(allocationSize = 1, name = "DETALLEINGRESO_DETALLESINGRESOSID_GENERATOR", sequenceName = "INVFAC.DETALLEINGRESO_DETALLESINGRESOSID_SEQ")
	@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "DETALLEINGRESO_DETALLESINGRESOSID_GENERATOR")
	@Column(unique = true, nullable = false)
	private Long detallesingresosid;

	@Column(nullable = false)
	private Integer cantidad;

	@Column(nullable = false, precision = 20, scale = 10)
	private BigDecimal descuento;

	@Column(nullable = false, precision = 20, scale = 10)
	private BigDecimal precio;

	// bi-directional many-to-one association to Bodega
	@ManyToOne
	@JoinColumn(name = "bodegaid", nullable = false)
	private Bodega bodega;

	// bi-directional many-to-one association to Ingreso
	@ManyToOne
	@JoinColumn(name = "ingresoid", nullable = false)
	private Ingreso ingreso;

	// bi-directional many-to-one association to Producto
	@ManyToOne
	@JoinColumn(name = "productoid", nullable = false)
	private Producto producto;

	public Detalleingreso() {
	}

	public Bodega getBodega() {
		return this.bodega;
	}

	public Integer getCantidad() {
		return this.cantidad;
	}

	public BigDecimal getDescuento() {
		return this.descuento;
	}

	public Long getDetallesingresosid() {
		return this.detallesingresosid;
	}

	public Ingreso getIngreso() {
		return this.ingreso;
	}

	public BigDecimal getPrecio() {
		return this.precio;
	}

	public Producto getProducto() {
		return this.producto;
	}

	public void setBodega(Bodega bodega) {
		this.bodega = bodega;
	}

	public void setCantidad(Integer cantidad) {
		this.cantidad = cantidad;
	}

	public void setDescuento(BigDecimal descuento) {
		this.descuento = descuento;
	}

	public void setDetallesingresosid(Long detallesingresosid) {
		this.detallesingresosid = detallesingresosid;
	}

	public void setIngreso(Ingreso ingreso) {
		this.ingreso = ingreso;
	}

	public void setPrecio(BigDecimal precio) {
		this.precio = precio;
	}

	public void setProducto(Producto producto) {
		this.producto = producto;
	}

}